package com.wjd.wshow.repository;

import com.wjd.wshow.entity.Video;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("VideoRepository")
public interface VideoRepository extends ResourceRepository<Video, String> {

    @Query("SELECT v FROM #{#entityName} v WHERE v.path LIKE :path% ORDER BY v.name")
    List<Video> findByPath(@Param("path") String path);

}
